import { createRouter, createWebHashHistory } from 'vue-router';

const routes = [
   {
     path: '/',
     redirect: '/selection'
   },
  {
    path: '/',
    name: 'home',
    component: () => import(
        '../views/Home.vue'
    ),
    children: [
        {
          path: 'course',
          name: '已选课程',
          component: () => import(
              '../views/Course.vue'
          )
        },
        {
            path: 'selection',
            name: '课程选择',
            component: () => import(
                '../views/Selection.vue'
                )
        },
        {
            path: 'user',
            name: '个人中心',
            component: () => import(
                '../views/User.vue'
                )
        },
    ],
  },
  {
     path: '/login',
     name: 'login',
     component: () => import(
       '../views/Login.vue'
     )
  },

]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
